﻿using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Assignment3.Entities
{
    public abstract class Entity
    {
        public string Name { get; set; }

        public Vector3 Position { get; set; }
        public Matrix Rotation { get; set; }
        public float Scale { get; set; }

        public Dictionary<string, Effect> Effects { get; set; }

        public Model Model { get; set; }
        public Texture2D Texture { get; set; }

        public Matrix ObjectWorld = Matrix.Identity;

        protected Camera Camera;

        protected Entity(Camera camera)
        {
            Position = new Vector3(0f, 0f, 0f);
            Rotation = Matrix.Identity;
            Scale = 1.0f;
            Camera = camera;
            Effects = new Dictionary<string, Effect>();
        }

        public virtual void Update(GameTime gt)
        {
            ObjectWorld = Matrix.CreateScale(Scale) * Rotation * Matrix.CreateTranslation(Position);
        }

        public abstract void Draw();
    }
}
